// lib/config/app_config.dart
import 'package:flutter/material.dart';

class AppConfig {
  static double _pageWidth = 0;
  static double _pageHeight = 0;

  // 初始化方法（需要在有 context 的地方调用）
  static void init(BuildContext context) {
    final mediaQuery = MediaQuery.of(context);
    _pageWidth = mediaQuery.size.width;
    _pageHeight = mediaQuery.size.height;
  }

  // / 添加序列化方法
  static Map<String, double> get dimensions => {'width': _pageWidth, 'height': _pageHeight};

  // 获取页面尺寸比例
  static double get pageWidthRatio => 1;
  static double get pageHeightRatio => 1;

  static double get pageWidth => _pageWidth * pageWidthRatio;
  static double get pageHeight => _pageHeight * pageHeightRatio;
}
